package com.lambda.demo.stream;

import com.lambda.demo.models.AuthorsData;

public class StreamMaxTest {
  public static void main(String[] args) {
    //计算年龄最大的作家的年纪
    AuthorsData.getAuthors().stream()
        .map(a -> a.getAge())
        .max((a,b) -> a - b)
        .ifPresent(x -> System.out.println(x));
  }
}
